package Song.Han.Demo02;

public class Demo02GenericClass {

    public static void main(String[] args) {

        //不写<E>默认Object类型
        GenericClass gc1 = new GenericClass();
        gc1.setName("只能是字符串");
        Object obj = gc1.getName();

        GenericClass<String> gc2 = new GenericClass<>();
        gc2.setName("张三");
        System.out.println(gc2.getName());


    }
}
